package com.aspose.cells;

class zalw implements zahf {
   private zig a;
   private int b;
   private Color c;
   private zamg d;
   private int e = 1;
   private boolean f;
   private boolean g = true;
   private zacm h;
   private boolean i = true;

   zalw(zig var1, int var2) {
      this.a = var1;
      this.b = var2;
      this.c = Color.getEmpty();
      this.d = new zamg();
      this.f = false;
   }

   zig e() {
      return this.a;
   }

   public Color a() {
      return this.e == 0 ? Color.getEmpty() : this.c;
   }

   public void a(Color var1) {
      this.c = var1;
   }

   public zamg f() {
      return this.d;
   }

   public void a(zamg var1) {
      this.d = var1;
   }

   public zahg b() {
      return this.d;
   }

   public boolean g() {
      return this.e != 0;
   }

   int h() {
      if (this.c() == 0) {
         return 0;
      } else {
         int var1 = zbuk.b(this.d.a());
         if (var1 < 1) {
            var1 = 1;
         }

         return var1;
      }
   }

   public int c() {
      return this.e;
   }

   public void a(int var1) {
      if (var1 != 3) {
         this.h = null;
      }

      this.e = var1;
   }

   zacm i() {
      return this.h;
   }

   void a(zacm var1) {
      this.h = var1;
   }

   public zagx d() {
      if (this.h == null) {
         this.h = new zacm();
         this.a(3);
      }

      return this.h;
   }

   public boolean a(zalw var1) {
      if (this.g() != var1.g()) {
         return false;
      } else {
         if (this.g() && var1.g()) {
            if (this.c() != var1.c()) {
               return false;
            }

            if (this.c() == 3) {
               if (!this.i().a(var1.i())) {
                  return false;
               }
            } else {
               if (!this.a().equals(var1.a())) {
                  return false;
               }

               if (!this.d.a(var1.f())) {
                  return false;
               }
            }
         }

         return true;
      }
   }

   public boolean b(zalw var1) {
      if (this.g() != var1.g()) {
         return false;
      } else {
         if (this.g() && var1.g()) {
            if (this.c() != var1.c()) {
               return false;
            }

            if (this.c() == 3) {
               if (!this.i().a(var1.i())) {
                  return false;
               }
            } else {
               if (!this.a().equals(var1.a())) {
                  return false;
               }

               if (!this.d.b(var1.f())) {
                  return false;
               }
            }
         }

         return true;
      }
   }

   public boolean j() {
      return this.g;
   }

   public void a(boolean var1) {
      this.g = var1;
   }

   void b(Color var1) {
      if (this.g && this.e != 0 || this.e == 1) {
         this.a(var1);
      }

   }

   void k() {
      if (this.i) {
         if (this.g) {
            switch(this.b) {
            case 0:
            case 2:
            case 4:
            case 5:
            case 13:
               if (this.a.R() <= 32) {
                  this.c = this.a.Z().a().a("tx1");
                  this.c = this.a.Z().a().a(this.c, 0.75D);
                  this.c = Color.a(255, (Color)this.c);
               } else {
                  this.c = this.a.Z().a().a("dk1");
                  this.c = this.a.Z().a().a(this.c, 0.75D);
                  this.c = Color.a(255, (Color)this.c);
               }
               break;
            case 1:
            case 10:
            case 11:
            case 12:
            case 14:
            case 15:
               this.c = Color.getEmpty();
               break;
            case 3:
               if (this.a.R() <= 32) {
                  this.c = this.a.Z().a().a("tx1");
                  this.c = this.a.Z().a().a(this.c, 0.5D);
                  this.c = Color.a(255, (Color)this.c);
               } else if (this.a.R() <= 40) {
                  this.c = this.a.Z().a().a("dk1");
                  this.c = this.a.Z().a().a(this.c, 0.5D);
                  this.c = Color.a(255, (Color)this.c);
               } else {
                  this.c = this.a.Z().a().a("dk1");
                  this.c = this.a.Z().a().a(this.c, 0.9D);
                  this.c = Color.a(255, (Color)this.c);
               }
               break;
            case 6:
               this.c = Color.getEmpty();
            case 7:
            case 8:
            case 9:
            default:
               break;
            case 16:
            case 17:
               if (this.a.R() <= 16) {
                  this.c = this.a.Z().a().a("tx1");
                  this.c = Color.a(255, (Color)this.c);
               } else if (this.a.R() <= 32) {
                  this.c = Color.getEmpty();
               } else if (this.a.R() <= 34) {
                  this.c = this.a.Z().a().a("dk1");
                  this.c = Color.a(255, (Color)this.c);
               } else if (this.a.R() <= 40) {
                  int var1 = this.a.R() - 34;
                  this.c = this.a.Z().a().a("accent" + var1);
                  this.c = this.a.Z().a().b(this.c, 0.25D);
                  this.c = Color.a(255, (Color)this.c);
               } else {
                  this.c = Color.getEmpty();
               }
               break;
            case 18:
            case 19:
            case 20:
            case 21:
            case 22:
            case 23:
               if (this.a.R() <= 32) {
                  this.c = this.a.Z().a().a("tx1");
                  this.c = Color.a(255, (Color)this.c);
               } else if (this.a.R() <= 34) {
                  this.c = this.a.Z().a().a("dk1");
                  this.c = Color.a(255, (Color)this.c);
               } else if (this.a.R() <= 40) {
                  this.c = this.a.Z().a().a("dk1");
                  this.c = Color.a(255, (Color)this.c);
               } else {
                  this.c = this.a.Z().a().a("lt1");
                  this.c = Color.a(255, (Color)this.c);
               }
            }

            this.i = false;
         }
      }
   }

   public Object l() {
      zalw var1 = new zalw(this.a, this.b);
      this.k();
      var1.a(this.a());
      var1.a(this.j());
      var1.a((zamg)this.f().l());
      var1.a(this.c());
      var1.a(this.h);
      return var1;
   }

   void a(float var1, float var2, float var3, float var4) {
      this.a(new com.aspose.cells.b.a.b.zo(var1, var2), new com.aspose.cells.b.a.b.zo(var3, var4));
   }

   void a(com.aspose.cells.b.a.b.zo var1, com.aspose.cells.b.a.b.zo var2) {
      com.aspose.cells.b.a.b.a.ze var3 = new com.aspose.cells.b.a.b.a.ze();
      var3.a(var1, var2);
      this.a(var3);
   }

   void a(com.aspose.cells.b.a.b.zp var1) {
      com.aspose.cells.b.a.b.zq var2 = new com.aspose.cells.b.a.b.zq((float)var1.c(), (float)var1.d(), (float)var1.e(), (float)var1.f());
      this.a(var2);
   }

   void a(com.aspose.cells.b.a.b.zq var1) {
      com.aspose.cells.b.a.b.a.ze var2 = new com.aspose.cells.b.a.b.a.ze();
      var2.b(var1);
      this.a(var2);
   }

   void a(com.aspose.cells.b.a.b.a.ze var1) {
      this.k();
      if (this.m()) {
         com.aspose.cells.b.a.b.a.ze var2 = var1.f();
         com.aspose.cells.b.a.b.zm var3 = this.b(var2);
         this.a.ap().a(var3, var1);
         var3.a();
      }
   }

   com.aspose.cells.b.a.b.zm b(com.aspose.cells.b.a.b.a.ze var1) {
      this.k();
      if (!this.m()) {
         return new com.aspose.cells.b.a.b.zm(Color.getEmpty());
      } else {
         com.aspose.cells.b.a.b.zm var2 = this.n();
         switch(this.c()) {
         case 3:
            if (this.d() != null) {
               com.aspose.cells.b.a.b.zc var3 = this.i().a(var1, var2, false, 1.0F);
               com.aspose.cells.b.a.b.zm var4 = new com.aspose.cells.b.a.b.zm(var3, (float)this.h());
               this.a(var4);
               return var4;
            }

            return var2;
         default:
            return var2;
         }
      }
   }

   private com.aspose.cells.b.a.b.zm n() {
      if (!this.m()) {
         return new com.aspose.cells.b.a.b.zm(Color.getEmpty());
      } else {
         com.aspose.cells.b.a.b.zm var1 = new com.aspose.cells.b.a.b.zm(this.a(), (float)this.h());
         this.a(var1);
         return var1;
      }
   }

   private void a(com.aspose.cells.b.a.b.zm var1) {
      zamg var2 = this.f();
      switch(this.b().c()) {
      case 2:
         var1.a(2);
      default:
         switch(var2.b()) {
         case 0:
            var1.b(5);
            var1.a(new float[]{4.0F, 3.0F});
            break;
         case 1:
            var1.b(5);
            var1.a(new float[]{4.0F, 3.0F, 1.0F, 3.0F});
            break;
         case 2:
            var1.b(5);
            var1.a(new float[]{8.0F, 3.0F});
            break;
         case 3:
            var1.b(5);
            var1.a(new float[]{8.0F, 3.0F, 1.0F, 3.0F});
            break;
         case 4:
            var1.b(5);
            var1.a(new float[]{8.0F, 3.0F, 1.0F, 3.0F, 1.0F, 3.0F});
            break;
         case 5:
            var1.b(2);
            break;
         case 6:
            var1.b(0);
            break;
         case 7:
            var1.b(5);
            var1.a(new float[]{3.0F, 1.0F});
         }

         switch(var2.d()) {
         case 1:
            var1.b(new float[]{0.0F, 0.16666667F, 0.33333334F, 0.6666667F, 0.8333333F, 1.0F});
            break;
         case 2:
            var1.b(new float[]{0.0F, 0.2F, 0.4F, 1.0F});
            break;
         case 3:
            var1.b(new float[]{0.0F, 0.6F, 0.8F, 1.0F});
            break;
         case 4:
            var1.b(new float[]{0.0F, 0.33333334F, 0.6666667F, 1.0F});
         }

         this.a(var1, var2);
      }
   }

   private void a(com.aspose.cells.b.a.b.zm var1, zamg var2) {
      if (var2.f() != 0) {
         this.a(var1, var2.f(), var2.g(), var2.h(), true);
      } else if (this.b().c() == 2) {
         var1.c(2);
      }

      if (var2.i() != 0) {
         this.a(var1, var2.i(), var2.j(), var2.k(), false);
      } else if (this.b().c() == 2) {
         var1.d(2);
      }

      switch(var2.e()) {
      case 1:
         var1.e(2);
         break;
      case 2:
         var1.e(1);
         break;
      case 3:
         var1.e(0);
      }

   }

   private void a(com.aspose.cells.b.a.b.zm var1, int var2, int var3, int var4, boolean var5) {
      float var6 = 0.0F;
      float var7 = 0.0F;
      if (var3 == 0) {
         var6 = 3.0F;
      } else if (var3 == 1) {
         var6 = 4.0F;
      } else {
         var6 = 5.0F;
      }

      if (var4 == 0) {
         var7 = 3.0F;
      } else if (var4 == 1) {
         var7 = 4.0F;
      } else {
         var7 = 5.0F;
      }

      com.aspose.cells.b.a.b.a.za var8;
      switch(var2) {
      case 1:
         var8 = new com.aspose.cells.b.a.b.a.za(var6, var7);
         if (var5) {
            var1.a((com.aspose.cells.b.a.b.a.zd)var8);
         } else {
            var1.b((com.aspose.cells.b.a.b.a.zd)var8);
         }
         break;
      case 2:
         var8 = new com.aspose.cells.b.a.b.a.za(var6, var7);
         var8.a(0.9F);
         if (var5) {
            var1.a((com.aspose.cells.b.a.b.a.zd)var8);
         } else {
            var1.b((com.aspose.cells.b.a.b.a.zd)var8);
         }
         break;
      case 3:
         if (var5) {
            var1.c(19);
         } else {
            var1.d(19);
         }
         break;
      case 4:
         if (var5) {
            var1.c(18);
         } else {
            var1.d(18);
         }
         break;
      case 5:
         com.aspose.cells.b.a.b.a.ze var9 = new com.aspose.cells.b.a.b.a.ze();
         var9.a(new com.aspose.cells.b.a.b.zo(var6 / 2.0F, -var7), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F));
         var9.a(new com.aspose.cells.b.a.b.zo(-var6 / 2.0F, -var7), new com.aspose.cells.b.a.b.zo(0.0F, 0.0F));
         com.aspose.cells.b.a.b.a.zd var10 = new com.aspose.cells.b.a.b.a.zd((com.aspose.cells.b.a.b.a.ze)null, var9);
         var10.a(0);
         var10.b(2);
         var10.a(2, 2);
         if (var5) {
            var1.a(var10);
         } else {
            var1.b(var10);
         }
      }

   }

   boolean m() {
      if (!this.g()) {
         return false;
      } else if (this.h() <= 0) {
         return false;
      } else {
         return !this.a().isEmpty() && this.a().getA() != 0;
      }
   }
}
